/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nol_app;

import java.util.ArrayList;
import java.util.Iterator;

/*
 * @author Sirius
 */
public class Tester {

	public static void main(String args[]) {
		DatabaseAPI nol = new DatabaseAPI();

		String[][] newAuthors = new String[2][2];
		newAuthors[0][0] = "David";
		newAuthors[0][1] = "Kroenke";

		newAuthors[1][0] = "David";
		newAuthors[1][1] = "Auer";

		nol.AddBook(
				"0132302675",
				"Database Processing: Fundamentals, Design, and Implementation",
				2010, newAuthors, 3);

		String[][] newAuthors2 = new String[1][2];
		newAuthors2[0][0] = "David";
		newAuthors2[0][1] = "Kroenke";

		nol.AddBook("0136100759", "Using MIS", 2010, newAuthors2, 1);

		nol.AddUser("Sam", "Stern", "sterno@gmail.edu", "392 14th Ave",
				"Seattle", "WA", "98102");
		nol.AddUser("Tessa", "Noelle", "glimmer@uw.edu", "4566 Linden St",
				"Tacoma", "WA", "98433");
		nol.AddUser("Martin", "Philip", "m.phil@hotmail.co.uk",
				"10 Lawernce Cr", "Kent", "WA", "98402");

		nol.ReserveBook(1, 2);
		nol.CheckoutBook(2, 3);
		nol.CheckinBook(2);

		ArrayList<Book> book_search = nol.Search("", "kroenke");
		Iterator<Book> itr = book_search.iterator();
		while (itr.hasNext()) {
			System.out.println(itr.next());
		}

	}
}
